/***
 * @description house目录中index.html主要js文件,可在此文件添加其他实现对象
 * 
 **/
(function(a){
	"use strict";
	/**
	 * 房产首页面初始化集合调用
	**/
	a.InitPage = function(w, $){
		return {
			init : function(){
				var t = this;
				//t.initWordBox();
				ImageRotate.init();
				DivClickHover.init();
				DivHoverHover.init();
		  		CityConvert.init();
				//newFocus.init();
				smallHover.init();
			},
			initWordBox : function(){
		        $("#wordBoxW").width($("#wordBoxW").parents().width()-$(".dailyimage").width()-3);
		        $("#wordBoxW").height($("#wordBoxW").parents().height());
		        $("#wordBox").wordbox({
		        	isFixedWidth: false,
		          	isLead: true,
		          	leadWord: leadWord,
		          	words: words,
		          	colors: colors
		        });
			}
		};
	}(a, jQuery);
	/**
	 * 焦点图片轮询方法
	**/
	a.ImageRotate = function(w, $){
		return {
			curIndex : 0,
			playID : "",
			interval : 6000,
			init : function(){
				var t = this;
				var label, imgCon;
				imgCon = $(".c1-left .tu");
				label = $(".duo span a", imgCon);
				$.each(label, function(index, val) {
					imgCon.append('<a href="'+$(this).data('link')+'" target="_blank" style="display: none; position: absolute; top: 0px;"><img src="'+$(this).attr('href')+'"/></a>');
				});
				label.on("hover", function(){t.curIndex = $(this).data("order"); t.selectedItme(this); return false;});
				label.on("click", function () {
					return false;
				});
				t.selectedItme(label[0]);
				t.showImageByTime();
				$(imgCon).css({display : "block"});
				$(".duo", imgCon).css({"z-index":"5", top:"160px"});
				$(imgCon).hover(function(){
					clearInterval(t.playID);
				}, function(){
					t.showImageByTime();
				});
			},
			selectedItme : function(cur){
				var t = this;
				var imgCon;
				imgCon = $(".c1-left .tu");
				$(cur).css("background-image","url(./static/image/shouye/wd_03.png)").siblings("a").css("background-image","url(./static/image/shouye/dian_03.png)");
				var index = $(cur).data("order");
				$(imgCon).children("a").eq(index).siblings("a").fadeOut('fast').end().fadeIn('slow');
				$(".duo p a", imgCon).attr("href", $(cur).data("link")).text($(cur).data("desc"));
				return false;
			},
			showImageByTime : function(){
				var t = this;
				var label, imgCon;
				imgCon = $(".c1-left .tu");
				label = $(".duo span a", imgCon);
				t.playID = setInterval(function(){
					t.curIndex++;
					if(t.curIndex > label.length-1){
						t.curIndex = 0;
					}
					t.selectedItme(label[t.curIndex]);
				}, t.interval);
			}
		};
	}(a, jQuery);
	/**
	 * 焦点图区域小图滑动效果
	**/
	a.smallHover = function(w,$){
		return {
			init: function(){
				var t;
				$(".h_smallDiv,.h_hotHouseSD").hover(function(){
					var cur = this;
					function smHover(){
						$(cur).children(".h_smTxt").animate({"bottom":0}, 300);
					}
					t = setTimeout(smHover, 100);
				},function(){
					clearTimeout(t);
					$(this).children(".h_smTxt").animate({"bottom":-70}, 300);
				});
			}
		}
	}(a, jQuery);
	/**
	 * 推荐层点击切换切换
	**/
	a.DivClickHover = function(w, $){
		return {
			init : function(){
				var qu = $(".qu");
				qu.children(".house_index_nav").find("a").not(".tui").on("hover", function(){
					$(this).addClass("hover");
					$(this).siblings("a").not("tui").removeClass("hover");
					var index = $(this).index();
					$(this).parents(".qu").find(".dl_contain").hide().eq(index-1).show();
				});
				var h_hotHouse = $(".h_hotHouse");
				h_hotHouse.children(".house_index_nav").find("a").not(".tui").on("hover", function(){
					$(this).addClass("hover");
					$(this).siblings("a").not("tui").removeClass("hover");
					var index = $(this).index();
					$(this).parents(".h_hotHouse").find(".dl_contain").hide().eq(index-1).show();
				});
			}
		};
	}(a, jQuery);
	/****
	*	层悬浮切换
	**/
	a.DivHoverHover = function(w, $){
		return {
			init : function(){
				$(".bie h2 a").hover(function(){
					$(this).addClass("hover").parent("h2").siblings("h2").find("a").removeClass("hover");
					var index = $(this).parent("h2").index();
					$(this).parents(".bie").find('span a').eq(index).show().siblings().hide();
					$(this).parents(".bie").parent("div").find(".anquyu").eq(index).show().siblings(".anquyu").hide();
				}, function(){});
			}
		};
	}(a, jQuery);
	/****
	*	热搜楼盘
	**/
	a.HotSearchHouse = function(w, $){
		return {
			init : function(){
				$(".touchid").each(function() {
		            $(this).hover(function(){
						$(this).parents(".showblockCont").children(".ping").removeClass("newHouse_show").find(".x_toggle").hide();
						$(this).parents(".box").next(".x_toggle").slideToggle("slow");
						$(this).parents(".ping").addClass("newHouse_show");
					},function(){
					
					});
		        });
			}
		};
	}(a, jQuery);

	/****************
	*	城市切换
	*	**页面top公用方法**
	**/
	a.CityConvert = function(w, $){
		return {
			init : function(){
				var t = this;
				var city = Cookie.getCookie("CHINASO_CITY");
				$(".newCity_List li").each(function(){
					$(this).text() == city ? t.convertText(this) : void 0;
				});
				t.initEvent();
			},
			initEvent : function(){
				var t = this;
				$(".newCity_List").find("a").click(function(){
		  			t.convertText(this);
		  		});
			},
			convertText : function(cur){
				var newCity = $(cur).text();
	  			$(".city_1").children(".cityText").text(newCity);
	  			$("#hidden").find("a").removeClass("on");
	  			$(cur).addClass("on").parents("#hidden").hide();
	  			Cookie.setCookie("CHINASO_CITY", newCity);
			},
			dIVShow : function (i){
			  if( document.getElementById(i).style.display===''){
				 document.getElementById(i).style.display = 'none';
			  }else{
				 document.getElementById(i).style.display = '';
			  };
			  if(document.getElementById(i).style.display==''){
				$(document).click(function(e){
					document.getElementById(i).style.display = 'none';
					e.stopPropagation();
				});
				$('.newCity_panel').click(function(e){
					e.stopPropagation();
				})
			};
		  	}
		};
	}(a, jQuery);
	/*****************************
	* 首页焦点图
	*
	***/
	a.newFocus = function(w, $){
		return {
			init: function(){
				$('#h_focus_pic li').hover(function(){
					var m = $('#h_focus_pic li').index(this);
					$('#h_focus_pic li').removeClass('cur').eq(m).addClass('cur');
					$('.h_newFocus p').hide().eq(m).show();
					$('.h_focus_text span').hide().eq(m).show();
				});
			}
		}
	}(a, jQuery);
	/*************************************************
	* 二手房资讯 index.js
	*
	***/
	a.Ershouhouse = function(w, $){
		return {
			url : "http://house.chinaso.com/static/json/",
			prefix : "",
			jsonName : "data",
			suffix : ".json",
			pageDisplayCount : 4,
			curShow : null,
			curShowType : 0,
			scrollEle : null,
			scrollSpeed : null,
			init : function(){
				var t = this;
				t.buildContainer();
				t.navTab();
				t.initEvent();
				t.executeAjax();
				$(document).on("click", ".abstract_con .page a, .title_con .page a", function(){
					var pageIndex = $(this).data("pageindex");
					t.curShow.data("pageIndex", pageIndex);
					t.scrollTop(t.scrollEle, t.scrollSpeed);
					t.executeAjax(pageIndex);
					return !1;
				});
				CityConvert.init();
			},
			scrollTop : function (ele, speed) {
				var toPx = 0,
					$ele;
				if (ele) {
					if (/^\d+$/.test(ele)) {
						toPx = ele;
					} else {
						$ele = $(ele);
						if ($ele.length > 0) {
							toPx = $ele.offset();
						}
					}
				}
				speed = speed || 400;
				$("html, body").animate({scrollTop: toPx + "px"}, speed);
			},
			navTab : function(){
				var t = this;
				var navNum = location.hash;
				var reg = new RegExp("#[0-9]");
				if(reg.test(navNum)){
					navNum = navNum.substring(1);
				}else{
					navNum = 0;
				}
				t.prefix = $(".newHouse_subnav a").eq(navNum).data("jsonpath");
				$(".house_messagelist").hide();
				t.curShow = $(".abstract_con").eq(navNum).show();
				//$(".newHouse_subnav a").eq(navNum).addClass("nav_act");
			},
			initEvent : function(){
				var t = this;
				$(".newHouse_subnav a").eq(0).addClass("nav_act");
				$("input[name='type']").eq(0).click();
				$(".newHouse_subnav a").click(function(){
					$(".newHouse_subnav a").removeClass("nav_act");
					$(this).addClass("nav_act");
					$(".house_messagelist").hide();
					var typecheck = $("input[name='type']").eq(0).is(":checked");
					if(typecheck){
						t.curShow = $(".abstract_con").eq($(this).index(".newHouse_subnav a")).show();
					}
					else{
						t.curShow = $(".title_con").eq($(this).index(".newHouse_subnav a")).show();
					}
					t.prefix = $(this).data("jsonpath");
					var pageIndex = t.curShow.data("pageIndex");
					if(t.curShow.children().length <= 0){
						t.executeAjax(pageIndex);
					}
				});
				$(".newHouse_subnav label").click(function(){
					$(".house_messagelist").hide();
					var navcheck = $(".newHouse_subnav a[class='nav_act']").index(".newHouse_subnav a");
					if($(this).index() === 0){
						t.curShow = $(".abstract_con").eq(navcheck).show();
						t.curShowType = 0;
					}
					else{
						t.curShow = $(".title_con").eq(navcheck).show();
						t.curShowType = 1;
					}
					var pageIndex = t.curShow.data("pageIndex");
					if(t.curShow.children().length <= 0){
						t.executeAjax(pageIndex);
					}
				});
				var navNum=location.hash;
				$(".newHouse_subnav ul li a").each(function(){
					var href=$(this).attr("href");
					if(href == navNum){
						$(".newHouse_subnav ul li a").removeClass("nav_act");
						$(this).addClass("nav_act");
					}
				})
				$(".newHouse_type_con").hide();
				$(".newHouse_type_con").eq(0).show();
				$(".newHouse_type_tag").each(function(i){
					$(this).click(function(){
						$(".newHouse_type_tag").removeClass("type_act");
						$(this).addClass("type_act");
						$(".newHouse_type_con").hide().eq(i).show();
					});
				});
				$(document).on({
					mouseenter : function(){
						$(this).addClass('listdetail_changebg');
					},
					mouseleave : function(){
						$(this).removeClass('listdetail_changebg');
					}
				}, ".listdetail");
				//HotSearchHouse.init();
			},
			executeAjax : function(pageIndex){
				var t = this;
				var page = "";
				pageIndex = pageIndex || 1;
				if(pageIndex > 1){
					page = "_"+pageIndex;
				}
				var typeText = $('input:radio[name="type"]:checked').data("path");
				var url = t.url + t.prefix + ("_" + typeText) + "/" + t.jsonName + page + t.suffix;
				AjaxSender.send(url, {}, "json").done(function(data){
					if(data.data && data.data.length > 0){
						if(t.curShowType === 0){
							t.buildSummaryHtml(data);
						}else if(t.curShowType == 1){
							t.buildTitleHtml(data);
						}
						if(data.totalPage > 1){
							t.buildPage(data, pageIndex);
						}
					}
				}).fail(function(data){
					//console.log(data);
					}
				);
			},
			buildContainer : function(){
				$(".newHouse_subnav a").each(function(){
					$(".newHouse_mainL").append('<div class="house_messagelist abstract_con"></div><div class="house_messagelist title_con"></div>');
				});
			},
			buildTitleHtml : function(datas){
				var t = this;
				var htmlContent = "<ul>";
				for(var i = 0; i < datas.data.length; i++){
					var curData = datas.data[i];
				    if((i % 5 === 0) && (i !== 0)){
				    	htmlContent += '</ul><ul>';
				    }
					var ind=curData.source.indexOf("_");
					if(ind != -1){
						curData.source=curData.source.substr(0,ind);
					}
					var Span='来源：'+curData.source+'&nbsp;&nbsp;';
					if(curData.source == ""){
						var Span=curData.source+'&nbsp;&nbsp;';
					}
					if(datas.isSameSource == 2){
						var Span='';
					}
					htmlContent += '<li><span class="fl">•<a target="_blank" href="'+curData.url+'">'+curData.title+'</a></span><em>'+Span+DateOperation.doTransfer(curData.detailtime)+'</em></li>';
				    
				}
				htmlContent += "</ul>";
				t.curShow.html(htmlContent);
			},
			buildSummaryHtml : function(datas){
				var t = this;
				var htmlContent = "";
				for(var i = 0; i < datas.data.length; i++){
					var curData = datas.data[i];
					var ind=curData.source.indexOf("_");
					if(ind != -1){
						curData.source=curData.source.substr(0,ind);
					}
					var Span='<span class="detailtime">来源：'+curData.source +'&nbsp;&nbsp;';
					if(curData.source == ""){
						var Span='<span class="detailtime">'+curData.source +'&nbsp;&nbsp;';
					}
					if(datas.isSameSource == 2){
						var Span='<span class="detailtime">';
					}
					htmlContent += '<div class="listdetail clearb">'+
				                    '<h2>'+
				                        '<a target="_blank" href="'+curData.url+'">'+curData.title+'</a>'+
				                        Span+ DateOperation.doTransfer(curData.detailtime)+
				                    '</span></h2>';
	            	if(curData.previewImage){
	            		htmlContent += '<div class="detailimg">';
		            	//for(var j = 0; j < curData.imageItems.length; j++){
		                	htmlContent += '<a target="_blank" href="'+curData.url+'"><img src="'+curData.previewImage+'" onerror="this.src=\'http://house.chinaso.com/static/image/default.gif\'"/></a>';
		            	//}
		            	htmlContent += '</div>';
	            	}
	                htmlContent += '<div class="abstract">'+
				                        '<p>'+curData.summary+'<a target="_blank" href="'+curData.url+'">详细></a></p>'+
				                    '</div>'+
				                '</div>';
				}
				t.curShow.html(htmlContent);
			},
			buildPage : function(data, pageIndex){
				var t = this;
				var pageContent = '<div class="page clearb">';
				if(pageIndex > 1){
					pageContent += '<span class="page_pre"><a href="javascript:void(0);" data-pageindex="'+(pageIndex-1)+'"><上一页</a></span>';
				}
				for(var i = 0; i < data.totalPage; i++){
					if(pageIndex == (i+1)){
						pageContent += '<span>'+(i+1)+'</span>'
					}else{
						if((((i+1) - pageIndex) <= t.pageDisplayCount && (pageIndex < (i+1))) || ((pageIndex - (i+1)) <= t.pageDisplayCount) && (pageIndex > (i+1)) || (i == 0)){
							pageContent += '<span><a href="javascript:void(0);" data-pageindex="'+(i+1)+'">'+(i+1)+'</a></span>';
						}else if((((i+1) - pageIndex) <= t.pageDisplayCount+1 && (pageIndex < (i+1))) || ((pageIndex - (i+1)) <= t.pageDisplayCount+1) && (pageIndex > (i+1))){
							pageContent += "<span>...</span>";
						}
					}
				}
				if(pageIndex < data.totalPage){
					pageContent += '<span class="page_next"><a href="javascript:void(0);" data-pageindex="'+(pageIndex+1)+'">下一页></a></span>';
				}
				pageContent += '</div>';
				t.curShow.eq(0).append(pageContent);
			}
		};
	}(a, jQuery);








	/*****************************************************
	*****************************************************
	* Common js 
	* @description Who's case
	* @version 0.1
	******************************************************
	******************************************************
	*/

	/***
	*	Live time operation
	*	@version 0.1
	**/
	a.DateOperation = function(){
		return {
			init : function(){},
			converte : function(str, flag){//转换字符串为时间
				str = str.replace(/-/g,"/");
				return new Date(str);
			},
		    doTransfer : function(original, curDate) {//执行时间差计算操作
		    	var t = this;
		    	original = t.converte(original);
		    	curDate = curDate || new Date();
		        var str = "";//用于存放返回的字符串  
		        original.setMilliseconds(0);//设置传入时间的毫秒为0  
		        curDate.setMilliseconds(0);//设置当前时间的毫秒为0  
		        var YEAR1 = 1000 * 60 * 60 * 24 * 365;//定义一年  
		        var YEAR2 = 1000 * 60 * 60 * 24 * 365 * 2;//定义两年  
		        var DAY = 1000 * 60 * 60 * 24;//定义一天  
		        var HOUR = 1000 * 60 * 60;//定义一个小时  
		        var MIN = 1000 * 60;//定义1分钟  
		        var diff = curDate - original;//取得当前时间与传入时间的时间差  
		        if ((diff - YEAR2) >= 0) {//判断是否是两年以上  
		            str += original.getFullYear() + "年";  
		            str += (original.getMonth() + 1) + "月" + original.getDate() + "日";  
		        } else {  
		            if ((diff - YEAR1) >= 0) {//判断是否是1年以上  
		                str += "1年前";  
		            } else {  
		                var subdaynum = -1;  
		                var workmonthnum = 0;  
		                for ( var i = original.getTime(); i <= curDate.getTime(); i = (i + DAY)) {  
		                    var days = new Date(i);  
		                    subdaynum++;  
		                    if (days.getDate() == 1) {  
		                        workmonthnum++;//记录当前时间与传入时间相差几个月  
		                    }  
		                }  
		                if (subdaynum >= 31) {//相差天数是否大于31天  
		                    str += workmonthnum + "个月前";  
		                } else {  
		                    if (subdaynum >= 1) {//相差天数是否大于1天  
		                        str += subdaynum + "天前";  
		                    } else {  
		                        var h = parseInt(diff / HOUR);  
		                        if (h >= 1) {//相差时间是否大于1小时  
		                            if ((curDate.getDate() - original.getDate()) == 1  
		                                    && h > 12) {//是否跨日期相差超过12小时  
		                                str += "1天前";  
		                            } else {  
		                                str += h + "小时前";  
		                            }  
		                        } else {  
		                            var m = parseInt(diff / MIN);  
		                            if (m >= 1) {//是否相差超过1分钟  
		                                str += m + "分钟前";  
		                            } else {  
		                                str += "刚刚";  
		                            }  
		                        }  
		                    }  
		                }  
		            }  
		        }  
		        return str;  
		    }
		};
	}(a, jQuery);

	/***
	*	Ajax common js code
	*	@version 0.1
	**/
	a.AjaxSender = function(w, $){
		return {
			init : function(){
				
			},
			send : function(url, params, dataType){
				params = params || {};
				params.timestamp = new Date().getTime();
				dataType = dataType || "html";
				return $.ajax({
					url : url,
					params : params,
					type : "get",
					dataType : dataType
				});
			}
		};
	}(a, jQuery);

	/*******
	*	Cookie common js code
	*	@verion 0.1
	**/
	a.Cookie = function(w, $){
		return {
			autoLogin : false,
			init : function(){

			},
			getCookieCount : function(){
				var cookieArray=document.cookie.split("; ");
				return cookieArray.length;
			},
			getCookie : function(name){
			   var cookieArray=document.cookie.split("; ");
			   for (var i=0;i<cookieArray.length;i++){    
				  var arr=cookieArray[i].split("=");
				  if(arr[0]==name)return decodeURIComponent(arr[1], "utf-8");
			   } 
			   return ""; 
			},
			delCookie : function(name){
			   document.cookie = name+"=;expires="+(new Date(0)).toGMTString();
			},
			matchDelCookie : function(){
				var t = this;
				var re = /CHINASO_.*/;
				var cookieArray=document.cookie.split("; ");
			    for (var i=0;i<cookieArray.length;i++){
				  var arr=cookieArray[i].split("=");
				  if(re.test(arr[0])){
					t.delCookie(arr[0]);
					//console.log("deleted goc:"+arr[0]);
				  }
			    }
			},
			setCookie : function(name,value,secure,saveTime){
				if(value){
					var t = this;
					var saveText = name + "=" + encodeURIComponent(value, "utf-8");
					if(t.getCookie("CHINASO_AUTOL") == "1" || t.autoLogin == "1" || saveTime){
						var Days = 14;
						var exp = new Date();
						saveTime = saveTime || Days*24*3600*1000;
						saveTime += exp.getTime();
						exp.setTime(saveTime);
						saveText += ";expires=" + exp.toGMTString();
					}
					if(secure === "secure"){
						saveText += ";secure";
					}
					document.cookie = saveText;
				}
			}
		};
	}(a, jQuery);

	a.IE6AjaxLoadJsCode = function(w, $) {
		return {
			init: function() {

			},
			setInnerHTML: function(el, htmlCode) {
				if (htmlCode) {
					var ieVersion = IEVERSION._IE();
					if (ieVersion && ieVersion <= 8) {
						var ua = navigator.userAgent.toLowerCase();
						htmlCode = htmlCode.replace(/<script([^>]*)>/gi, '<script$1 defer>');
						if (ua.indexOf('msie') >= 0 && ua.indexOf('opera') < 0) {
							htmlCode = '<div style="display:none">for IE</div>' + htmlCode;
							htmlCode = htmlCode.replace(/<script([^>]*)>/gi, '<script$1 defer>');
							el.innerHTML = htmlCode;
							el.removeChild(el.firstChild);
						} else {
							script_tmp = new Array();
							reg = /<script[^>]*>([\s\S]*?)<\/script>/ig;
							script_reg = "";
							while (htmlCode.search(reg) + 1) {
								script_tmp = htmlCode.match(reg);
								htmlCode = htmlCode.replace(script_tmp[0], "");
								script_tmp[0] = script_tmp[0].replace(/<script([^>]*)>/gi, '')
								script_tmp[0] = script_tmp[0].replace(/<\/script>/gi, '')
								script_reg = script_reg + "\n\r" + script_tmp[0];
							}
							var el_next = el.nextSibling;
							var el_parent = el.parentNode;
							el_parent.removeChild(el);
							el.innerHTML = htmlCode;
							if (el_next) {
								el_parent.insertBefore(el, el_next)
							} else {
								el_parent.appendChild(el);
							}
							if (script_reg) {
								var script = document.createElement("script")
								script.type = "text/javascript";
								script.text = script_reg;
								el.appendChild(script);
							}
						}
					} else {
						$(el).html(htmlCode);
					}
				}
			}
		};
	}(a, jQuery);

	a.IEVERSION = function(){
	  return {
	    _IE : function(){
	      	var v = 3, div = document.createElement('div'), all = div.getElementsByTagName('i');
			while (
			    div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
			    all[0]
			);
			return v > 4 ? v : false;
	    }
	  };
	}();

}(window));
$(document).ready(function() {
	var lujing = window.location.href,
		reg1=/beijing/,
		reg2=/shanghai/,
		reg3=/tianjin/,
		reg4=/guangzhou/,
		reg5=/hangzhou/,
		reg6=/wuhan/,
		reg7=/shenzhen/,
		reg8=/suzhou/,
		reg9=/chongqing/;
	if (reg1.test(lujing)) {
		$('.city_1').children(".cityTxt").text('北京');
		$('.toph1 a').attr('href','http://house.chinaso.com/beijing.html');
	}else if(reg2.test(lujing)){
		$('.city_1').children(".cityTxt").text('上海');
		$('.toph1 a').attr('href','http://house.chinaso.com/shanghai.html');
	}else if(reg3.test(lujing)){
		$('.city_1').children(".cityTxt").text('天津');
		$('.toph1 a').attr('href','http://house.chinaso.com/tianjin.html');
	}else if(reg4.test(lujing)){
		$('.city_1').children(".cityTxt").text('广州');
		$('.toph1 a').attr('href','http://house.chinaso.com/guangzhou.html');
	}else if(reg5.test(lujing)){
		$('.city_1').children(".cityTxt").text('杭州');
		$('.toph1 a').attr('href','http://house.chinaso.com/hangzhou.html');
	}else if(reg6.test(lujing)){
		$('.city_1').children(".cityTxt").text('武汉');
		$('.toph1 a').attr('href','http://house.chinaso.com/wuhan.html');
	}else if(reg7.test(lujing)){
		$('.city_1').children(".cityTxt").text('深圳');
		$('.toph1 a').attr('href','http://house.chinaso.com/shenzhen.html');
	}else if(reg8.test(lujing)){
		$('.city_1').children(".cityTxt").text('苏州');
		$('.toph1 a').attr('href','http://house.chinaso.com/suzhou.html');
	}else if(reg9.test(lujing)){
		$('.city_1').children(".cityTxt").text('重庆');
		$('.toph1 a').attr('href','http://house.chinaso.com/chongqing.html');
	};
	//搜索为空时
	$('.search_btn2').on('click',function(){
		var val=$('.search_input2').val();
		if(val == ''){
			if((lujing.indexOf('searchBuilding') != -1) || (lujing.indexOf('secondhandHouse') != -1) || (lujing.indexOf('searchRentHouse') != -1)){
				return true;
			}
			return false;
		}
		return true;
	});
});
